package com.motu.vertx.module.utility.commondata;

import io.vertx.core.json.JsonObject;

public class BannedUserModel {
    protected byte type; // 封号类型 (0-封角色 1-封帐号 2-封设备)
    protected String accountId; // 帐号id
    protected long userId; // 用户Id
    protected int platform; // 平台号
    protected String deviceId; // 设备id
    protected long banTime; // 封号结束时间
    protected String ip; // ip

    public BannedUserModel() {
    }

    public BannedUserModel(JsonObject obj) {
        type = obj.containsKey("type") ? obj.getInteger("type").byteValue() : 0;
        accountId = obj.containsKey("account_id") ? obj.getString("account_id") : "";
        userId = obj.containsKey("user_id") ? obj.getLong("user_id") : 0;
        platform = obj.containsKey("platform") ? obj.getInteger("platform") : 0;
        deviceId = obj.containsKey("device_id") ? obj.getString("device_id") : "";
        banTime = obj.containsKey("ban_time") ? obj.getLong("ban_time") : 0;
        ip = obj.containsKey("ip") ? obj.getString("ip") : "";
    }

    public byte getType() {
        return type;
    }

    public String getAccountId() {
        return accountId;
    }

    public long getUserId() {
        return userId;
    }

    public int getPlatform() {
        return platform;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public long getBanTime() {
        return banTime;
    }

    public String getIp() {
        return ip;
    }

}
